package chapterSystem.client;

import chapterSystem.client.entities.Pair;
import chapterSystem.client.entities.UnitInfo;
import chapterSystem.client.model.entitiesInt.*;
import chapterSystem.client.model.enums.ActivityType;
import com.google.gwt.user.client.rpc.AsyncCallback;

import java.util.List;
import java.util.Map;

public interface ChapterSystemServiceAsync {
    void checkCookie(String cookie, AsyncCallback<Brother> async);

    void login(String username, String pass, AsyncCallback<Brother> async);

    void getReportsById(int id, AsyncCallback<List<Report>> async);

    void getOrdersById(int id, AsyncCallback<Pair<List<Order>, List<Order>>> async);

    void getEvents(int eventCount, java.sql.Date fromDate, java.sql.Date toDate, AsyncCallback<List<ChapterEvent>> async);
    void createNewBrother(Brother brother, String password, AsyncCallback<String> async);

    void getUnitInfo(int id, final AsyncCallback<UnitInfo> async);
    void getAllUnits(final AsyncCallback<Map<String, Unit>> async);

    void addLog(final int brotherId, final ActivityType type, final String message, final AsyncCallback<String> async);

    void submitOrderExecution(Order order, String briefReport, AsyncCallback<String> async);

    void createBattleOrder(Order order, AsyncCallback<String> async);

    void editBattleOrderText(Order order, AsyncCallback<String> async);

    void editExecutionReport(Order order, AsyncCallback<String> async);

    void getBrotherByLogin(String login, final AsyncCallback<Brother> async);

    void editBrother(Brother brother, final AsyncCallback<String> async);

    void getBrotherLog(int brotherId, AsyncCallback<List<String>> async);

    void submitReport(int brotherId, int eventId, String reportText, AsyncCallback<String> async);

    void getReportsByEvent(int eventId, int brotherRank, AsyncCallback<List<Report>> async);

    void editReport(Report report, AsyncCallback<String> async);

    void createEvent(ChapterEvent event, AsyncCallback<String> async);
}
